package objbo.xmlparser.view.interfaces;

import java.util.List;

import objbo.xmlparser.model.ModelMain;
import objbo.xmlparser.model.bean.ElementBean;

public class ElementInterFace
{
	private ModelMain model = null;

	public ElementInterFace(ModelMain model)
	{
		this.model = model;
	}

	public void setModel(ModelMain model)
	{
		this.model = model;
	}

	public ElementBean getDocument()
	{
		return this.model.getElementFinder().getDocumentData();
	}

	public ElementBean getElement(ElementBean elementBean)
	{
		return this.model.getElementFinder().getElementData(elementBean);
	}

	public List<ElementBean> getsubElementList(ElementBean elementBean)
	{
		return this.model.getElementListFinder().getNextElementList(elementBean);
	}

	public ElementBean getParentElement(ElementBean elementBean)
	{
		return this.model.getElementFinder().getParentElementData(elementBean);
	}

	public boolean addElement(ElementBean parentElementBean, String name)
	{
		return this.model.getElementModiFier().elementAdd(parentElementBean,
				name);
	}

	public boolean removeElement(ElementBean elementBean)
	{
		return this.model.getElementModiFier().elementRemove(elementBean);
	}
	
	public boolean removeElement(ElementBean parentBean, int index)
	{
		return this.model.getElementModiFier().elementRemove(parentBean, index);
	}

	public boolean modifyElementName(ElementBean elementBean, String name)
	{
		return this.model.getElementModiFier().nameModify(elementBean, name);
	}

	public boolean modifyElementContent(ElementBean elementBean, String content)
	{
		return this.model.getElementModiFier().contentModify(elementBean,content);
	}

	public boolean AddAttribute(ElementBean elementBean,String name, String data)
	{
		return this.model.getElementModiFier().attributeAdd(elementBean, name,	data);
	}

	public boolean ModifyAttribute(ElementBean elementBean,	String name, String data, int index)
	{
		return this.model.getElementModiFier().attributeModify(elementBean,	name, data, index);
	}

	public boolean RemoveAttribute(ElementBean elementBean,	int index)
	{
		return this.model.getElementModiFier().attributeRemove(elementBean,	index);
	}

}
